<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆</title>
    <link rel="stylesheet" href="../css/common.css">
    <style>
        body{
            /*background: #ffffff url("../image/bg2.jpg")no-repeat;*/
            /*background-position: center center;*/
        }
        .main{
            background: #ffffff url("../image/bg2.jpg")no-repeat;
            background-position: top center;
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            background-size: contain;
        }
        .bodyer{
            display: flex;
            justify-content: space-around;
            align-items: center;
            overflow: hidden;
            height: 100%;
            /*background: #e5e5e5;*/
            /*background: #fbfbfb url("../image/bg2.jpg")no-repeat;*/
            /*background-size: contain;*/
        }
        .header_t{
            border-bottom: 1px solid #3e93ff;
            background: #146ffb;
            /*background: red;*/
            height: 40px;
        }
        .header_b{
            height: 90px;
            width: 100%;
            background: url("../image/bg1.png")no-repeat;
            background-size: cover;
            background-position: center bottom;

        }
        .header_b>div{
            width: 65%;
            height: 100%;
            position: relative;
        }
        .header_b .news{
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(25,102,203,0.9);
            height: 40px;
        }
        .header_b .news>div{
            flex : 1;
        }
        .header_b .news>div>p{
            cursor: pointer;
            width: 100%;
            color: #ffffff;
            text-indent: 50px;
            justify-content: flex-start;
            font-size: 12px;
        }
        .header_b .news>div:nth-of-type(2)>p{
            border-left: 1px solid #ffffff;
        }
        p{
            margin:  0 ;
        }
        body .header_t_c{
            width: 65%;
            height: 100%;
            justify-content: space-between;
            color: #ffffff;
        }
        .header_t_c>div{
            height: 100%;
        }
        .header_t_c ul {
            height: 100%;
        }
        .header_t_c ul li{
            height: 100%;
            padding: 0px 15px;
            box-sizing: border-box;
        }
        .header_t_c ul li span{
            display: flex;
            height: 100%;
            cursor: pointer;
        }
        body .header_t_c ul .ul_active{
            border-bottom: 2px solid #ffffff;
            box-sizing: border-box;
        }
        .photo{
            width: 30px;
            height: 30px;
            border-radius: 50%;
        }
        .name{
            padding: 0px 10px;
        }
        .quit_btn{
            color: #72afff;
            font-style: normal;
            font-size: 12px;
            height: 100%;
            cursor: pointer;
        }
        .power{
            margin: 100px auto;
            height: 300px;
            width: 420px;
            box-sizing: border-box;
            padding:20px 30px 30px 30px;
            background: #ffffff;
            box-sizing: border-box;
            box-shadow: 2px 2px 2px #c7c7c7;
            border: 1px solid #dfdfe3;
        }
        .login_box_main{
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
        }
        .login_box_main input{
            width: 100%;
            outline: none;
            border: none;
            text-indent: 10px;
            line-height: 44px;
            box-sizing: border-box;
            border: 1px solid #dfdfe3;
            /*margin-top: 10px;*/
        }

        .login_box_main button{
            /*margin-top: 20px;*/
            width: 100%;
            outline: none;
            border: none;
            background: #1772fa;
            color: #ffffff;
            font-size: 16px;
            cursor: pointer;
            line-height: 40px;
        }
        .login_box_main p{
            font-size: 20px;
        }
        .login_box_main>div{
            width: 100%;
            height: 44px;
        }
        .login_box_main>div>div{
            width: 70px;
        }

    </style>
</head>
<body>
<div class="main">
    <!--<div class="header">-->
        <!--<div class="header_t flex">-->
            <!--<div class="header_t_c flex">-->
                <!--<div class="flex">动态信息知识库</div>-->
                <!--<div>-->
                    <!--<ul class="flex">-->
                        <!--<li class="flex"><span class="flex">首页</span></li>-->
                        <!--<li class="flex"><span class="flex">知识库</span></li>-->
                        <!--<li class="flex"><span class="flex">系统管理</span></li>-->
                        <!--&lt;!&ndash;<li class="flex"><span class="flex">登陆</span></li>&ndash;&gt;-->
                        <!--<li class="flex">-->
                            <!--&lt;!&ndash;<i class="photo"></i><span class="flex name">你好</span><i class="quit_btn flex">退出</i>&ndash;&gt;-->
                        <!--</li>-->
                    <!--</ul>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="header_b flex">-->

        <!--</div>-->
    <!--</div>-->
    <div class="bodyer">
        <div class="power">
            <div class="login_box_main">
                <p>军用标准化动态信息</p>
                <div class="flex">
                    <div>用户名</div><input type="text" autocomplete="off" id="name" placeholder="请输入用户名">
                </div>
                <div class="flex">
                    <div>密码</div><input type="password" autocomplete="off" id="password" placeholder="请输入密码">
                </div>
                <button class="login_btn">登录</button>
            </div>
        </div>
    </div>
</div>
<script src="../js/url.js"></script>
<script src="../js/jquery.min.js"></script>
<script src="../js/common.js"></script>
<script>
    var can_submit = true;
    $(function () {
        $('.login_btn').on('click',function(){
            if(can_submit){
                can_submit = false;
                common_fn()
            }
        })

        document.onkeydown = function(e) {
            if (e.keyCode == 13&&can_submit) {
                can_submit = false;
                common_fn()
            }
        }
    })

    function common_fn(){
        var name = $('#name').val(),pass = $('#password').val();
        if(name==""){
            alert("用户名不能为空")
            return
        }
        if(pass==""){
            alert("密码不能为空")
            return
        }
        jq_post(ajax_url.login,{"username":name,"password":pass},function (res) {
            if(res.userInfo){
                set_storage({"userInfo":JSON.stringify(res.userInfo)})
                url_jump('home')
            }else{
                can_submit = true
            }
        })
    }
</script>
</body>
</html>